package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class FluxSinkExample {
    public static void main(String[] args) {
        Flux.create(fluxSink -> {
                    for (int i = 0; i < 5; i++) {
                        fluxSink.next(i); // 发送元素
                    }
                    fluxSink.complete(); // 发送完成信号
                })
                .subscribe(System.out::println);
    }
}
